// src/utils/dateUtils.js
export function formatDate(dateString) {
    const date = new Date(dateString);
    const yyyy = date.getFullYear(); // 使用完整的四位年份
    const MM = String(date.getMonth() + 1).padStart(2, '0');
    const dd = String(date.getDate()).padStart(2, '0');
    const h = String(date.getHours()).padStart(2, '0'); // 补齐小时位数
    const m = String(date.getMinutes()).padStart(2, '0');
    const s = String(date.getSeconds()).padStart(2, '0');
    return `${yyyy}-${MM}-${dd} ${h}:${m}:${s}`;
}